<?php

namespace app\api\controller;
use think\Controller;
use think\Request;
use think\facade\Log;
use app\api\model\LangClassVideoTransfer AS LangClassVideoTransferModel;
use app\common\controller\Send;
class Notify extends Controller
{
    
    use Send;
   
    /**
     * 视频转码结果通知
     */
    public function transfer(){
        $data = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input");
        $d = json_decode($data,true);
        $jobId = $d['jobId'];
        $data = LangClassVideoTransferModel::getRecordByJobId($jobId);
        if(empty($data)){
            return self::sendResult(100, [], 'no found');
        }else if($data['status'] != 0 ){
            return self::sendResult(100, [], 'done');
        }else{
            LangClassVideoTransferModel::updateRecord($data,1);

            return self::sendResult(self::$okCode, [], 'ok');
        }

        
    }
    
    
}